
import java.util.*;
public class text79 {
    public static void main(String[]args)
    {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        // 注意 while 处理多个 case
        String s="123a45c";
        String s1="";
        String s2="";
        int i=0;
        for(i=0;i<s.length();i++)
        {
            char ch=s.charAt(i);
            if(ch>='0'&&ch<='9')
            {
                s1=s1+ch+"";
                //s1="";
            }
            else
            {
                if(s1.length()>s2.length())
                {
                    s2=s1;
                    s1="";
                }
                else
                {
                    s1="";
                }
            }

        }
        if(i==s.length()&&s1.length()>s2.length())
        {
            s2=s1;
        }

        System.out.println(s2);




        }






    }

